<?php echo $left ?>
<script>
$( document ).ready(function() {
	$.ajaxSetup({
		cache: false
	});
	$( '.sidebar' ).simpleSidebar({
		settings: {
			opener: '#open-sb',
			wrapper: '.wrapper',
			animation: {
				duration:0,
				easing: 'easeOutQuint'
			}
		},
		sidebar: {
			align: 'left',
			width: 214,
			closingLinks: 'a',
		}
	});
$("a.chakan").click(function(){
		$(".tan_link2").addClass("tan_hovers2");
		})
	$("a#gbck").click(function(){
		$(".tan_link2").removeClass("tan_hovers2");
		})	
	$("a#tcxt").click(function(){
		$("div#tcxt").addClass("tan_hovers");
		})	
	$("a#tcxt2").click(function(){
		$("div#tcxt2").addClass("tan_hovers");
		})	
});
</script>
<style>
	.tishi>p{
		line-height:54px;
		font-size:17px;
	}
	.tishi .btn input{
		width:120px;
		height:30px;
		color:#fff;
		background-color:#4fa602;
	}
	.tishi1 {
    position: absolute;
    width: 290px;
    left: 50%;
    margin-left: -105px;
    top: 30%;
    background-color: #f5f5f5;
    color: #525252;
    box-shadow: -5px 5px 10px 1px rgba( 11, 2, 5, 0.3 );
   // display: none;
}


.tishi1 h6 {
    color: #1d3e00;
    text-align: center;
    line-height: 50px;
	font-size:17px;
}
.tishi1 .btn1 {
    text-align: center;
}
.tishi1 .btn1 input{
    width: 90px;
    height: 40px;
    background-image: url(../public/img/btn3.png);
    background-size: 100% 100%;
    background-repeat: no-repeat;
    color: white;
    margin-right: 15px;
    margin-left: 15px;
    margin-top: 25px;
    margin-bottom: 25px;
    line-height: 24px;
}
#msg_box{display:none;}
.tishi{
	position:fixed;
	top:200px;
	left:50%;
	margin-left:-130px;
	background-color:#fff;
}
</style>
<div class="clear"></div>
<div  class="w640">
      <div class="yd3 pt50"><span class="ydtxt">公益收益中心</span> - 接受公益帮助</div>
      <?php echo form_open('mobile/accept_help/info_post', array('id'=>'myform')); ?>
	  <table cellpadding="0" cellspacing="0" class="biao">
	     <tr>
		    <td class="w140x pr10">选择钱包</td>
            <td class="txtts">
            	<input type="radio" name="order_type" value="0" checked="checked" id='radio' />公益静态钱包（<?=$user['jt_money']?>）
            	<div class="clear"></div>
            	<input type="radio" name="order_type" value="1"  />公益推广钱包（<?=$user['tg_money']?>）</td>
		 </tr>
		 
		 <tr>
		    <td class="w140x pr10">金额</td>
			<td><input name="money" id="money" type="text"  class="input1"/><b style='position:relative;top:15px;left:5px;' class='js-b'></b><div class="clear"></div>
			   <p class="txttx">公益静态钱包：2000起提现100的倍数
                  <br />公益推广钱包：1000起提现500的倍数
               </p>
			</td>
		 </tr>
		 <tr>
		    <td colspan="2" >
		        <div class="inp360"><a href="#" class="inputt" id="inputt" onclick="">确认提交</a></div></td>
		 </tr>
  </table>
  </form>
      <div class="dx"></div>
	  <div class="yd2"><span class="ydtxt">公益收益中心</span>  - 接受公益帮助订单</div>
	  <table cellpadding="0" cellspacing="0" class="liebiao">
	     <tr>
<!--		    <th>公<br />益<br />编<br />号</th>-->
            <th style="width:70px;padding-left:10px;">申<br />请<br />日<br />期</th>
			<th>收<br />益<br />金<br />额</th>
			<th>钱<br />包</th>
			<th>剩<br />余<br />收<br />款<br />时<br />间</th>
			<th>合<br />作<br />人<br />信<br />息</th>
			<th>状<br />态</th>
			<th>操<br />作</th>
			<th>打<br />款<br />凭<br />证</th>
	     </tr>
		  <?php foreach($log_list as $log): ?>
			  <tr>

				  <td style="width:70px;padding-left:10px;" class="number"><?php echo date('Y-m-d',$log['sq_time']) ?><br/><?php echo date('H:i:s',$log['sq_time']) ?></td>
				  <td><?php echo $log['money'] ?></td>
				  <td><?php echo $order_type[$log['order_type']] ?></td>
				  <td>
					  <?php
					  if($log['dakuan'] == 1 && $log['dakuan_time'] != 0)
					  {
					  		if($log['shoukuan'] == '1'){
								echo '已完成';
							}else{
								$sy_time = 43200 - ((time() - $log['dakuan_time']));
								if($sy_time > 0 ){
									echo '<span class="settime" endTime="'.$sy_time .'"></span>';
								}else{
									echo '已完成';
								}
							}
					  }
					  ?>
				  </td>
				  <td class=" caozuo chakan">
					  <span class="btn_show" style='color:blue;'>查看</span>
					  <div class="tishi" style='display:none'>
						  <?php $three_hours = time() - $log['pp_time'];?>
						  <?php if($three_hours > 10800 || $log['dakuan'] == 1): ?>
							  <p><span>公益账号：</span><b><?php echo substr_replace($log['user_account'],'***',3,3) ?></b></p>
							  <p><span>姓名：</span><b><?php echo $log['user_name'] ?></b></p>
							  <p><span>电话：</span><b><?php echo $log['mobile'] ?></b></p>
							  <p><span>支付宝号：</span><b><?php echo $log['zfb_account'] ?></b></p>
							  <p><span>微信号：</span><b><?php echo $log['wx_id'] ?></b></p>
						  <?php else:?>
							  <p><span>公益账号：</span><b><?php echo substr_replace($log['user_account'],'***',3,3) ?></b></p>
							  <p><span>姓名：</span><b><?php echo $log['user_name'] ?></b></p>
							  <p><span>电话：</span><b><?php echo substr_replace($log['mobile'],'****',3,4) ?></b></p>
							  <p><span>支付宝号：</span><b><?php echo substr_replace($log['zfb_account'],'***',3,3) ?></b></p>
							  <p><span>微信号：</span><b><?php echo substr_replace($log['wx_id'],'***',3,3) ?></b></p>
						  <?php endif;?>
						  <!--<p><span>支付宝号：</span><b><?php echo substr_replace($log['zfb_account'],'***',3,3) ?></b></p>
                                        <p><span>微信号：</span><b><?php echo substr_replace($log['wx_id'],'***',3,3) ?></b></p>-->
						  <p><span>银行账号：</span><b><?php echo $log['bank_card'] ?></b></p>
						  <p><span>匹配金额：</span><b><?php echo $log['money'] ?></b></p>
						  <p><span>匹配时间：</span><b><?php echo date("Y-m-d H:i:s",$log['pp_time']) ?></b></p>
						  <?php if($three_hours > 10800 || $log['dakuan'] == 1): ?>
							  <p><span>推荐人姓名：</span><b><?php echo $log['up_user_name'] ?></b></p>
							  <p><span>电话：</span><b><?php echo $log['up_mobile'] ?></b></p>
						  <?php else:?>
							  <p><span>推广人姓名：</span><b><?php echo substr_replace($log['up_user_name'],'***',3,3) ?></b></p>
							  <p><span>电话：</span><b><?php echo substr_replace($log['up_mobile'],'***',3,3) ?></b></p>
						  <?php endif;?>
						  <p class="btn"><input class="btn_close" type="button" value="关闭" name="关闭"></p>
					  </div>
				  </td>
				  <td><?php echo $dakuan_type[$log['dakuan']] ?></td>
				  <td class="caozuo" style='line-height:30px;'>
					  <?php if($log['dakuan'] == 1 && $log['shoukuan'] == 0): ?>
						  <b class="dakuan"  style='color:blue;' url="<?php echo site_url('mobile/accept_help/change_shoukuan_type/1/'.$log['id']) ?>">确认收款</b><br>
						  <b class='buda'  style='color:red;' url="<?php echo site_url('mobile/accept_help/change_shoukuan_type/2/'.$log['id']) ?>">未收到款</b>
					  <?php else:?>
						  <?php  $str_arr = array(0=>'',1=>'已收款',2=>'未收款',4=>'');echo $str_arr[$log['shoukuan']]; ?>
					  <?php endif; ?>
				  </td>
				  <td class="green">
					  <?php if($log['dakuan'] == 1): ?>
						  <a href="<?php echo base_url().'uploads/'.$log['img_url'] ?>" target="_blank">查看</a>
					  <?php endif; ?>
				  </td>
			  </tr>
		  <?php endforeach; ?>
  </table>
</div>
<div id="tcxt" class="tan_link">
<span class="tan_links">您确定要退出平台吗？</span><div class="tanann"><input type="button"  class="tanbt left" value="是"/><input type="button"  class="tanbt right" value="否" /></div></div>
<div id="tcxt2" class="tan_link">
<span class="tan_links">请您选择钱包</span><div class="tanann"><input type="button"  class="taninp"  value="是"/></div>
</div>
<div id="cha" class="tan_link2">
  <table  class="cbiao" cellspacing="0" cellpadding="0">
    <tr>
      <td class="w100 pr10">公益账号：</td>
	  <td width="434">152****2546</td>
    </tr>
	<tr>
      <td class="w100 pr10">姓名：</td>
	  <td width="434">某某</td>
    </tr>
	<tr>
	  <td class="w100 pr10">电话：</td>
	  <td>15643252568</td>
    </tr>
	<tr>
	  <td class="w100 pr10">支付宝号：</td>
	  <td>15643252568</td>
    </tr>
	<tr>
	  <td class="w100 pr10">微信号：</td>
	  <td>15643252568</td>
    </tr>
	<tr>
	  <td class="w100">银行账号：</td>
	  <td>15643252568</td>
    </tr>
	<tr>
	  <td class="w100">匹配金额：</td>
	  <td><span class="w100 pr10">200</span></td>
    </tr>
	<tr>
	  <td class="w100">匹配时间：</td>
	  <td>2016-08-10  11:08：30</td>
    </tr>
	<tr>
	  <td class="w100">推荐人姓名：</td>
	  <td>&nbsp;</td>
    </tr>
	<tr>
	  <td class="w100">电话：</td>
	  <td>&nbsp;</td>
    </tr>
	<tr>
	  <td colspan="2"><a href="javascript:;" class="taninp pb20" id="gbck">关闭</a></td>
    </tr>
  </table>
</div>
<div id="msg_box" class="tishi1">
	<h6>是否确认收款</h6>
	<p class="btn1">
		<input id="btn_sk_on" type="button" value="是" name="是">
		<input id="btn_sk_off" type="button" value="否" name="否">
	</p>
</div>
<script type="text/javascript">
function updateEndTime(){
	$(".settime").each(function(i){
		var lag = this.getAttribute("endTime");//(endTime - time) / 1000; //当前时间和结束时间之间的秒数
		$(this).attr("endTime",lag-1);
		if(lag > 0)
		{
			var time_str = '';
			if(lag > 86400){
				time_str += Math.floor((lag / 3600) / 24)+'天';
				console.log(time_str);
			}
			if(lag >3600){
				time_str += Math.floor((lag / 3600) % 24)+"小时";
				console.log(time_str);
			}
			if(lag > 60)
			{
				time_str += Math.floor((lag / 60) % 60)+"分";
				console.log(time_str);
			}
			if(lag > 0)
			{
				time_str += (Math.floor(lag % 60) >= 10 ? Math.floor(lag % 60) : "0" + Math.floor(lag % 60))+"秒";
				console.log(time_str);
			}

			$(this).html(time_str);
		}
		else{
			$(this).removeClass("settime");
			$(this).html("已过期");
		}
	});
	setTimeout("updateEndTime()",1000);
}
$(function(){
	$('.js-tishi').on('click',function(){
		$('.js-tishi').css('display','none');
	})
    $('#inputt').on('click', function(event) {
        if($('#money').val() == ''){
		 $('.js-b').text('请输入金额');
            //alert('请输入金额');
            return false;
			
        }else{
			$('.js-b').text('');
		}
		if($(":radio:checked").attr("id")=="radio"){
			if($('#money').val()<2000){
				$('.js-b').text('必须大于2000');
				return false;
			}else if($('#money').val()%1000!=0){
				$('.js-b').text('必须是100的倍数');
				return false;
			}else if($('#money').val()>10000){
				$('.js-b').text('必须小于10000');
				return false;
			}else{
				$('.js-b').text('');
			}
			
		}else{
			if($('#money').val()<1000){
				$('.js-b').text('必须大于1000');
				return false;
			}else if($('#money').val()%500!=0){
				$('.js-b').text('必须是500的倍数');
				return false;
			}else if($('#money').val()>10000){
				$('.js-b').text('必须小于10000');
				return false;
			}else{
				$('.js-b').text('');
			}
		}
		
			
		
        $('#myform').submit();
    });

    //收款按钮点击
    $('.dakuan').on('click',function(){
		$('#msg_box').hide();
        $('#msg_box').show();
		$('#msg_box>h6').text('是否确认收款');
		$('#btn_sk_off').on('click',function(){
            $('#msg_box').hide();
        })

        $('#btn_sk_on').on('click',function(){
			 var url = $('.dakuan').attr('url');
				window.location.href=url;
        })
      
    });
	
    $('.btn_show').on('click',function(){
        $($(this).next()).show();
		$("html").css("background-color","rgba(0,0,0,0.5)");
        $('.btn_close').on('click',function(){
            $('.tishi').hide();
			$("html").css("background-color","#fff)");
        })


    })
	$(".btn_show").each(function(){
		$(this).click(function(){
			$(this).siblings(".tishi").fadeIn();
		});
	});
	$('.buda').on('click',function(){
        var url = $(this).attr('url');
		$('#msg_box').hide();
        $('#msg_box').show();
		$('#msg_box>h6').text('是否确未收到款');


        $('#btn_sk_on').on('click',function(){
            location.href=url;
        })
    });
	
	/**查看关闭按钮**/
	$(".btn_close").each(function(){
		$(this).click(function(){
			$(this).parent().parent().fadeOut();
		});
	});
	//遍历倒计时
	updateEndTime();
})
</script>
<?php echo $foot; ?>